package com.epwk.element;

import com.epwk.driver.SeleniumDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

/**
 * Created by Administrator on 2016/11/21.
 */
public class WebEle extends SeleniumDriver {
    final static com.epwk.logger.LoggerControler log= com.epwk.logger.LoggerControler.getLogger(WebEle.class);


    public static WebElement findElement(By by){

        WebElement webElement = null;
        try{
            webElement = new WebDriverWait(driver,10).until(ExpectedConditions.presenceOfElementLocated(by));

        }catch (Exception e){
            log.error("元素没找到");
            e.printStackTrace();
        }
        return webElement;
    }
}
